home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / examples / tcl / x05.tcl < prev    next >
Text File  |  1994-08-09  |  883b  |  38 lines

  1. # $Id: x05.tcl,v 1.2 1994/08/09 08:23:25 mjl Exp $
  2. # $Log: x05.tcl,v $
  3. # Revision 1.2  1994/08/09  08:23:25  mjl
  4. # Changed to new tclMatrix notation.
  5. #
  6. # Revision 1.1  1994/06/30  18:49:37  mjl
  7. # Tcl demo programs, which fully reproduce their x??c counterpart.
  8. #
  9. #----------------------------------------------------------------------------
  10. # PLplot Tcl demo #5
  11. #
  12. # After sourcing, just type "5".
  13. #----------------------------------------------------------------------------
  14.  
  15. proc 5 {} {
  16.     set npts 2047
  17.     matrix data f $npts
  18.  
  19. # Fill up data points
  20.  
  21.     plssub 1 1
  22.     plbop
  23.  
  24.     set delta [expr 2.0 * 3.141592654 / $npts]
  25.     for {set i 0} {$i < $npts} {incr i} {
  26.     data $i = [expr sin($i * $delta)]
  27.     }
  28.  
  29.     plcol 1
  30.     plhist $npts data -1.1 1.1 44 0
  31.  
  32.     plcol 2
  33.     pllab "#frValue" "#frFrequency" \
  34.     "#frPLplot Example 5 - Probability function of Oscillator"
  35.  
  36.     pleop
  37. }
  38.